package com.ts.file;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 
 * @description：读取配置通用处理工具类
 * @author xhc
 * @version Created by xhc on 2017-3-22.
 */
public class SysProperties {
	
    private  Properties properties = new Properties();

    public SysProperties() {

    }

    public SysProperties(String sFileName) {
        try {
            InputStream is = this.getClass().getClassLoader().getResourceAsStream(sFileName);
            properties.load(is);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * 根据key读取对应的value
     * @param key
     * @return
     */
    public  String getValue(String key){
        return properties.getProperty(key);
    }
}
